#ifndef WXSIMAGELISTEDITORDLG_H
#define WXSIMAGELISTEDITORDLG_H

#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/checkbox.h>
#include <wx/colordlg.h>
#include <wx/panel.h>
#include <wx/filedlg.h>
#include <wx/bmpbuttn.h>
#include <wx/button.h>
#include "scrollingdialog.h"
#include "wxsimagelistproperty.h"
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/imaglist.h>
#include "wxsbitmapiconeditordlg.h"

class wxsItem;

class wxsImageListEditorDlg: public wxScrollingDialog {
  public:
    wxsImageListEditorDlg( wxWindow* parent );
    virtual ~wxsImageListEditorDlg();
    bool Execute( wxString &inName, wxArrayString &aImageData );
    static  void ImageToArray( wxImage &inImage, wxArrayString &outArray );
    static  void ArrayToImage( wxArrayString &inArray, wxImage &outImage );
    static  void BitmapToArray( wxBitmap &inBitmap, wxArrayString &outArray );
    static  void ArrayToBitmap( wxArrayString &inArray, wxBitmap &outBitmap );
    static  void ImageListToArray( wxImageList &inList, wxArrayString &outArray );
    static  void ArrayToImageList( wxArrayString &inArray, wxImageList &outList );
    static  void CopyImageList( wxImageList &inList, wxImageList &outList );
    static  wxsItem *FindTool( wxsItem *inItem, wxString inName );
    static  int CalcArraySize( wxArrayString &inArray );
    static  bool SaveXPM( wxImage * image, wxOutputStream& stream );
    wxStaticText* StaticText10;
    wxStaticText* StaticText22;
    wxStaticText* StaticText9;
    wxStaticText* StaticText20;
    wxButton* bOK;
    wxPanel* Panel5;
    wxBitmapButton* bSaveList;
    wxStaticText* StaticText29;
    wxBitmapButton* bRight;
    wxButton* bCancel;
    wxStaticText* StaticText13;
    wxStaticText* StaticText2;
    wxPanel* Panel4;
    wxStaticText* StaticText14;
    wxStaticText* StaticText6;
    wxStaticText* StaticText26;
    wxPanel* Panel11;
    wxBitmapButton* bSave;
    wxPanel* Panel9;
    wxStaticText* StaticText19;
    wxStaticText* StaticText8;
    wxStaticText* StaticText11;
    wxBitmapButton* bClear;
    wxStaticText* StaticText18;
    wxBitmapButton* bAdd;
    wxPanel* Panel8;
    wxPanel* Panel1;
    wxColourDialog* ColourDialog1;
    wxStaticText* StaticText1;
    wxStaticText* StaticText27;
    wxFileDialog* FileDialog1;
    wxStaticText* StaticText3;
    wxPanel* Panel6;
    wxStaticText* StaticText21;
    wxPanel* Panel3;
    wxButton* bColor;
    wxStaticText* StaticText23;
    wxStaticText* StaticText24;
    wxStaticText* StaticText5;
    wxStaticText* StaticText7;
    wxPanel* Panel7;
    wxBitmapButton* bLeft;
    wxCheckBox* cxTransparent;
    wxStaticText* StaticText28;
    wxStaticText* StaticText15;
    wxStaticText* StaticText12;
    wxPanel* Panel2;
    wxPanel* Panel10;
    wxStaticText* StaticText25;
    wxBitmapButton* bDel;
    wxStaticText* StaticText4;
    wxStaticText* StaticText17;
    wxPanel* Panel12;
    wxBitmapButton* bRead;
    wxStaticText* StaticText16;
  protected:
    static const long ID_STATICTEXT1;
    static const long ID_STATICTEXT15;
    static const long ID_STATICTEXT16;
    static const long ID_STATICTEXT17;
    static const long ID_STATICTEXT18;
    static const long ID_STATICTEXT26;
    static const long ID_STATICTEXT19;
    static const long ID_STATICTEXT27;
    static const long ID_BITMAPBUTTON1;
    static const long ID_PANEL2;
    static const long ID_STATICTEXT2;
    static const long ID_PANEL3;
    static const long ID_STATICTEXT3;
    static const long ID_PANEL4;
    static const long ID_STATICTEXT4;
    static const long ID_PANEL5;
    static const long ID_STATICTEXT5;
    static const long ID_PANEL8;
    static const long ID_STATICTEXT6;
    static const long ID_PANEL6;
    static const long ID_STATICTEXT7;
    static const long ID_PANEL7;
    static const long ID_STATICTEXT8;
    static const long ID_PANEL9;
    static const long ID_STATICTEXT9;
    static const long ID_PANEL10;
    static const long ID_STATICTEXT10;
    static const long ID_PANEL11;
    static const long ID_STATICTEXT12;
    static const long ID_BITMAPBUTTON2;
    static const long ID_STATICTEXT11;
    static const long ID_PANEL1;
    static const long ID_STATICTEXT23;
    static const long ID_BITMAPBUTTON5;
    static const long ID_STATICTEXT20;
    static const long ID_CHECKBOX1;
    static const long ID_BUTTON2;
    static const long ID_STATICTEXT21;
    static const long ID_BITMAPBUTTON3;
    static const long ID_STATICTEXT13;
    static const long ID_STATICTEXT22;
    static const long ID_PANEL12;
    static const long ID_STATICTEXT28;
    static const long ID_BITMAPBUTTON4;
    static const long ID_STATICTEXT14;
    static const long ID_BITMAPBUTTON6;
    static const long ID_STATICTEXT24;
    static const long ID_BITMAPBUTTON7;
    static const long ID_STATICTEXT25;
    static const long ID_BITMAPBUTTON8;
    static const long ID_STATICTEXT29;
    static const long ID_BUTTON1;
    static const long ID_BUTTON4;
  private:
    void OnbAddClick( wxCommandEvent& event );
    void OnbReadClick( wxCommandEvent& event );
    void OnPanel1Paint( wxPaintEvent& event );
    void OnbColorClick( wxCommandEvent& event );
    void OnPanel1LeftUp( wxMouseEvent& event );
    void OncxTransparentClick( wxCommandEvent& event );
    void OnbOKClick( wxCommandEvent& event );
    void OnbCancelClick( wxCommandEvent& event );
    void OnbLeftClick( wxCommandEvent& event );
    void OnbRightClick( wxCommandEvent& event );
    void OnPanel2LeftUp( wxMouseEvent& event );
    void OnPanel3LeftUp( wxMouseEvent& event );
    void OnPanel4LeftUp( wxMouseEvent& event );
    void OnPanel5LeftUp( wxMouseEvent& event );
    void OnPanel8LeftUp( wxMouseEvent& event );
    void OnPanel6LeftUp( wxMouseEvent& event );
    void OnPanel7LeftUp( wxMouseEvent& event );
    void OnPanel9LeftUp( wxMouseEvent& event );
    void OnPanel10LeftUp( wxMouseEvent& event );
    void OnPanel11LeftUp( wxMouseEvent& event );
    void OnPanel12Paint( wxPaintEvent& event );
    void OnbDelClick( wxCommandEvent& event );
    void OnbClearClick( wxCommandEvent& event );
    void OnbSaveClick( wxCommandEvent& event );
    void OnbSaveListClick( wxCommandEvent& event );
    void PaintPreviewPanel( wxPaintEvent& event );

    void PreviewImport( void );
    void PreviewList( void );
    void PreviewSelected( void );
    void UpdateEnabled( void );
    void SelectPreviewPanel( int aIndex );
    void PaintPanel( wxPaintDC &aDC, wxPanel *aPanel, wxBitmap &aBitmap, bool aHot = false );

    wxImageList m_ImageList;
    wxImage m_ImportImage;
    wxColour m_ImportMask;
    wxsBitmapIconEditorDlg *m_ImageDialog;
    wxsBitmapIconData m_ImageData;
    int m_FirstImage;
    wxPanel *m_PreviewPanel[10];
    wxStaticText *m_PreviewLabel[10];
    int m_PreviewSelect;
    DECLARE_EVENT_TABLE()
};

#endif
